<?php if($this->user()->isTranslator() && !$this->user()->isAdministrator()): ?>
<h2>Continue Translation</h2>
<p class="desc">Select a language which you want to continue translating.</p>

<form action="<?php echo $this->url(array('action' => 'view', 'controller' => 'language'), 'default', true) ?>" method="get">

<label for="language" class="inline">Translation Language:</label>
<select id="language" name="language" style="margin-right: 1em;">
	<?php foreach($this->mylanguages as $language): ?>
	<option value="<?php echo $this->escape($language->code) ?>">
		<?php echo $this->escape($language->name) ?>
	</option>
	<?php endforeach; ?>
</select>
<input type="submit" value="Continue Translation" class="fancybutton" />

</form>
<?php endif; ?>

<h2>Languages</h2>
<p class="desc">Click on language name to view the translation and get more details
on the process.</p>

<div class="grid" style="line-height: 1.5em;">
<?php foreach($this->languages as $language): ?>
<div class="box_3 first">
	<a href="<?php echo $this->url(array('action' => 'view', 'controller' => 'language', 'code' => $language->code), 'default', true) ?>"> 
		<?php echo $this->escape($language->name) ?>
	</a>
</div>

<?php if($language->original == 1): ?>
<div class="box_9 last">
	<strong>Original</strong> 
	<small class="desc" style="margin-left: 1em;">(no translation necessary)</small>
</div>
<?php else: ?>
<div class="box_9 last progress_bg">
	<div class="progress_fg" style="width: <?php echo $language->progress*100 ?>%;"><?php echo floor($language->progress*100) ?>%</div>
</div>
<?php endif; ?>

<div class="clear" style="margin-bottom: 0.2em;">&nbsp;</div>
<?php endforeach; ?>
</div>

<?php if($this->user()->isAdministrator()): ?>
<div style="text-align: center; margin-top: 2em;">
<a href="<?php echo $this->url(array('controller' => 'language', 'action' => 'add'), 'default', true) ?>" class="fancybutton" style="margin-right: 1em;">Add a Language</a>
<a href="<?php echo $this->url(array('controller' => 'bundle', 'action' => 'manage'), 'default', true) ?>" class="fancybutton">Manage Bundles</a>
</div>
<?php endif; ?>

<!-- 
<h2>Start a new Translation</h2>
<p class="desc">Start a translation to a new language.</p>

<form action="<?php echo $this->url(array('action' => 'create', 'controller' => 'language'), 'default', true) ?>" method="post">
<div class="grid">
<div class="box_6 first">
<label for="name">Language Name:</label>
<input type="text" style="width: 60%;" id="name" name="name" /> <span class="example">Example: French</span>
<p class="help">The name of the new language.</p>

<label for="code">Locale:</label>
<input type="text" style="width: 30%;" id="code" name="code" /> <span class="example">Example: fr</span>
<p class="help">A short code for the new language consisting of letters, hyphens ( &#150; ) and
underscores ( _ ).</p>
</div>

<div class="box_6 last">

<label>Based upon:</label>
<p class="help">Select what content the new translation should have at the beginning.</p>

<input type="radio" name="basedupon" value="file" id="basedupon_file" />
<label for="basedupon_file" class="inline noformat">Existing <code>.properties</code> file:</label>
<br />
<input type="file" name="base_file" id="base_file" style="margin-left: 1.8em;" />
<br />

<input type="radio" name="basedupon" value="language" id="basedupon_language" checked="checked" />
<label for="basedupon_language" class="inline noformat">Existing language:</label>

<select name="base_language" id="base_language" style="margin-left: 1.8em; width: 70%;">
	<?php foreach($this->languages as $language): ?>
	<option value="<?php echo $this->escape($language->code) ?>">
		<?php echo $this->escape($language->name) ?>
	</option>
	<?php endforeach; ?>
</select>

</div>

<div class="clear">&nbsp;</div>
</div>

<div style="text-align: center; margin-top: 0.6em;">
	<input type="submit" value="Create Translation" class="fancybutton" />
</div>

</form>
 -->